-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial Object Store implementation #150
Conversation
@@ -18,6 +18,21 @@ public interface ICountableBufferWriter : IBufferWriter<byte> | |||
int WrittenCount { get; } | |||
} | |||
|
|||
public readonly struct FixedSizeMemoryOwner : IMemoryOwner<byte> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, what is the benefit of using this over MemoryPool<byte>.Shared
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MemoryPool.Shared.Rent returns at least the size asked for, which usually rounds up to some 2^n. This wrapper chops the memory to exact size so when it's passed to stream read/write or down the line to publish or something you won't need to pass the actual size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw, we are still renting it from MemoryPool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw, we are still renting it from MemoryPool.
Ah, I see that now. Clever!
# Conflicts: # NATS.Client.sln
Missed one!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Co-authored-by: Caleb Lloyd <[email protected]>
Object store initial implementation.
Features:
Missing features: